package cn.org.spring.wechar.service.message;

import cn.org.spring.wechar.bean.message.Articles;
import cn.org.spring.wechar.bean.message.NewsMessage;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class NewsMessageService implements IMessage {
    @Override
    public String handler(Map<String, Object> param) {
        List<Articles> articles = new ArrayList<>();
        Articles article = new Articles();
        article.setDescription("图文消息信息，注意，如果图文数超过限制，则将只发限制内的条数");
        article.setTitle("图文消息信息");
        article.setPicUrl("https://pic1.zhimg.com/80/v2-506171687dfd564cf82f9a8bd12f0dca_1440w.jpg?source=1940ef5c");
        article.setUrl("www.baidu.com");
        articles.add(article);
        return NewsMessage.ofSend(param, articles).toXml();
    }
}